.danmu-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* 在水平和垂直方向上都居中 */
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1; /* 设置较高的层级，确保在视频上方 */
}

.danmu-item {
  position: absolute;
  white-space: nowrap;
  animation: danmu-move 10s linear infinite;
  color: white;
  font-size: 16px;
  text-shadow: 1px 1px 2px black;
  right: 100%; /* 从视频的右侧开始 */
  top: 50%; /* 垂直方向上居中 */
  transform: translateY(-50%); /* 垂直方向上精确居中 */
}

@keyframes danmu-move {
  from {
    transform: translateX(100%) translateY(-50%);
  }
  to {
    transform: translateX(-100%) translateY(-50%);
  }
}


.danmu-input-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.danmu-input-container input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-right: 10px;
  width: 200px;
}

.danmu-input-container button {
  padding: 8px 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.danmu-input-container button:hover {
  background-color: #0056b3;
}
